<script setup>
	import { uniFetch } from '../../utils/fetch';
	import { onShow } from "@dcloudio/uni-app"
import { reactive, ref } from 'vue';

	onShow(() => {
		getdata()
	})
	const info = ref({});
	const pictureList=ref([])
	const getdata = () => {
		uniFetch({
			url: "/driver/users/truck"
		}).then(res => {
			console.log(res, 'res');
			info.value = res.data.data
			pictureList.value=res.data.data.pictureList
		
		})
	}
</script>

<template>
	<view class="page-container">
		<swiper class="truck-pictures" indicator-active-color="#fff" circular indicator-dots>
			<swiper-item v-for="(item,index) in pictureList">
				<image class="picture" mode="aspectFill" :src="item.url"></image>
			</swiper-item>

		</swiper>
		<view class="truck-meta">
			<uni-list :border="false">
				<uni-list-item :border="false" title="车辆编号" :rightText="info.id" />
				<uni-list-item :border="false" title="车辆号牌" :rightText="info.licensePlate" />
				<uni-list-item :border="false" title="车型" :rightText="info.truckType" />
				<uni-list-item :border="false" title="所属机构" :rightText="info.currentOrganName" />
				<uni-list-item :border="false" title="载重" :rightText="`${info.allowableLoad}`+'吨'" />
			</uni-list>
		</view>
	</view>
</template>

<style lang="scss" scoped>
	@import './index.scss';
</style>